<template>
  <!-- 项目列表 -->
  <ul class="mallList clearfix"
      :class="mallList.length > 0 ? '':'mallList_bg'">
    <li class="list-item"
        @tap.stop="to_detail(item)"
        v-for="(item, index) in mallList"
        :key="index">
      <div class="box">
        <div class="image">
          <img v-if="imgUrl&&item.image"
               :src="imgUrl+item.image"
               :lazy-load="true"
               class="img" />
          <span class="buyingImg"
                v-html="item.activity_status==1?'即将开抢':'抢购中'"
                v-if="item.activity_status == 1 || item.activity_status == 2"></span>
          <div class="mallImg_top"
               v-if="item.tag_name && item.tag_name !== null">{{item.tag_name?item.tag_name:''}}</div>
        </div>
        <div class="content">
          <h4 class="project-name">
            <!-- <span
              class="wei"
              v-if="item.is_repair ==1"
              :class="item.insurance_is_set==2?'wei1':''"
            >维</span>
            <span class="bao" v-if="item.insurance_is_set==2">保</span>-->
            {{item.name}}
          </h4>
          <div class="hos-info clearfix"
               v-if="item.hospitalIsShow==0">
            <div class="hos-name"
                 v-if="item.hospitals_name!==null">{{item.hospitals_name}}</div>
            <div class="distance">
              <!-- <img :src="ImgBaseUrl+'shouye/dingwei@2x.png'" alt class="locate"> -->
              {{item.distance}}km
            </div>
          </div>
          <div class="bookednum clearfix"
               :class="item.hospitalIsShow == 1?'bookednum1':''">{{item.appointment_peoples==null?'0':item.appointment_peoples}}人已预约</div>
          <!-- <p class="user_point" v-if="item.activity_status==4 && item.deduction_credit > 0">
            积分可抵
            <span class="icon">￥</span>
            {{item.deduction_credit}} 
          </p>-->
          <div class="price">
            <div class="old-price clearfix">
              <div class="num"></div>
            </div>
            <div class="bottom clearfix">
              <div class="left clearfix">
                <span v-if="item.activity_status==1 || item.activity_status==3">优惠价</span>
                <span class="num"
                      v-if="item.activity_status!==4">
                  <span class="icon">￥</span>
                  {{item.discounts}}
                </span>
                <span class="num"
                      v-if="item.activity_status==4">
                  <span class="icon">￥</span>
                  {{item.project_price}}
                </span>
                <span class="icon1"
                      v-if="item.activity_status==3">起</span>
              </div>
              <div class="right clearfix"
                   v-if="item.insurance_is_set==2">
                <img :src="imgUrl+'h5_images/mp_images/mp_3.1.1/bt/zmb.png'"
                     alt
                     class="img" />
              </div>
              <div class="right wei"
                   v-if="item.is_repair ==1">
                <img :src="imgUrl+'h5_images/mp_images/mp_3.1.1/bt/wq.png'"
                     alt
                     class="img" />
              </div>
            </div>
          </div>
        </div>
      </div>

      <div class="plus"
           v-if="item.activity_status!== 2 && item.plus_title">
        <img src="https://img.ameimeika.com/h5_images/lifebeauty/plus_tag.png"
             alt
             class="tag" />
        {{item.plus_title}}
      </div>
      <div class="pointbox"
           v-if="item.deduction_method !=0 && item.deduction_credit > 0">
        <img :src="item.deduction_method==1?'https://mmkapp.oss-cn-beijing.aliyuncs.com/h5_images/mp_images/mp_3.1.6/mmk_3.1.6/lab_silver.png':'https://mmkapp.oss-cn-beijing.aliyuncs.com/h5_images/mp_images/mp_3.1.6/mmk_3.1.6/lab_gold.png'"
             alt
             class="tag" />
        <block v-if="item.project_price==item.deduction_credit">全{{item.deduction_method==1?'金币':'银币'}}抵扣</block>
        <block v-else>{{item.deduction_method==1?'金币':'银币'}}可抵{{item.deduction_credit}}元</block>
      </div>
    </li>
    <!-- <div class="zhanwei"></div> -->
  </ul>
</template>

<script>
export default {
  data () {
    return {
      imgUrl: "https://img.ameimeika.com/",
      ImgBaseUrl: "https://h5.ameimeika.com/mp_images/"
    };
  },
  watch: {
    mallList (newval, oldval) {
      this.mallList = newval;
    }
  },
  props: {
    mallList: []
  },
  methods: {
    to_detail (item) {
      wx.navigateTo({
        url: "/pages/package_projects/project_detail/main?id=" + item.id
      });
    }
  }
};
</script>
<style scoped lang="less">
.mallList {
  width: 100%;
  box-sizing: border-box;
  padding: 0 10px;
  background: rgba(243, 244, 246, 1);
  .title {
    line-height: 50px;
    text-align: center;
    color: #666666;
    font-size: 12px;
    font-family: "Regular";
    background-color: #fff;
  }
  .list-item {
    width: 100%;
    min-height: 120px;
    display: block;
    width: 100%;
    min-height: 120px;
    background: #fff;
    padding-bottom: 12px;
    margin-bottom: 10px;
    box-shadow: 0px 2px 6px 0px rgba(240, 240, 240, 1);
    border-radius: 5px;
    .box {
      display: flex;
      .image {
        flex: 3;
        min-height: 100%;
        padding-left: 10px;
        border-radius: 2px;
        position: relative;
        .mallImg_top {
          width: 22px;
          height: 22px;
          overflow: hidden;
          white-space: nowrap;
          box-sizing: border-box;
          background: url("https://h5.ameimeika.com/mp_images/mp_2.7/icon_intergralmall_list_tag.png")
            no-repeat;
          background-size: 100% 100%;
          line-height: 15px;
          text-align: center;
          position: absolute;
          top: 6px;
          left: 12px;
          font-size: 9px;
          font-family: "PingFangSC";
          font-weight: 500;
          color: rgba(255, 255, 255, 1);
        }
        .img {
          width: 114px;
          height: 114px;
          display: block;
          margin-top: 10px;
          // background-color: #ccc;
          border-radius: 4px;
        }
        .buyingImg {
          width: 44px;
          height: 17px;
          line-height: 17px;
          background: linear-gradient(
            315deg,
            rgba(230, 27, 100, 1) 0%,
            rgba(255, 56, 62, 1) 100%
          );
          border-radius: 4px;
          position: absolute;
          z-index: 1;
          color: #fff;
          text-align: center;
          font-size: 10px;
          bottom: 6px;
          right: 6px;
        }
      }
      .content {
        flex: 7;
        min-height: 100px;
        padding-right: 10px;
        margin-left: 10px;
        position: relative;
        .project-name {
          font-size: 14px;
          font-family: "Medium";
          color: #333;
          margin-top: 8px;
          line-height: 19px;
          overflow: hidden;
          text-overflow: ellipsis;
          display: -webkit-box;
          -webkit-line-clamp: 2;
          -webkit-box-orient: vertical;
          .bao,
          .wei {
            width: 16px;
            height: 16px;
            display: inline-block;
            font-size: 12px;
            text-align: center;
            border: 1px solid #fff;
            box-sizing: border-box;
            border-radius: 2px;
            margin-bottom: 6px;
            line-height: 14px;
          }
          .wei {
            color: #ff383e;
            border-color: #ff383e;
            &.wei1 {
              margin-right: 4px;
            }
          }
          .bao {
            color: #0070ff;
            border-color: #0070ff;
            background: #fff;
          }
        }
        .hos-info {
          font-size: 12px;
          font-family: "Regular";
          color: #999;
          margin-top: 4px;
          .hos-name {
            width: 70%;
            float: left;
            color: #999;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 1;
            -webkit-box-orient: vertical;
          }
          .distance {
            float: right;
            position: relative;
            .locate {
              width: 14px;
              height: 13px;
              vertical-align: baseline;
              position: absolute;
              top: 10%;
              left: -15px;
            }
          }
        }
        .bookednum {
          font-size: 12px;
          color: #999;
          // margin: 4px 0 12px 0;
          }
        }

          // position: absolute;
          // bottom: 28px;
          font-size: 12px;
          color: #ff383e;
          .icon {
            font-size: 7px;
          }
        }
        .price {
          width: 100%;
          position: absolute;
          bottom: 0;
          height: 26px;
          line-height: 36px;
          .old-price {
            vertical-align: bottom;
            .num {
              font-size: 10px;
              font-family: "Regular";
              color: rgba(204, 204, 204, 1);
              float: left;
              position: relative;
              &::before {
                content: "";
                width: 100%;
                height: 1px;
                background-color: rgba(204, 204, 204, 1);
                position: absolute;
                left: 0;
                top: 50%;
                transform: translateY(-50%);
                z-index: 1;
              }
            }
          }
          .available_points {
            font-size: 12px;
            color: #ff383e;
            .coin {
              font-size: 10px;
            }
            .num {
              font-size: 16px;
            }
          }
          .bottom {
            width: 100%;
            height: 100%;
            .left {
              height: 100%;
              font-size: 12px;
              float: left;
              font-family: "Regular";
              color: #ff383e;
              .num {
                font-size: 18px;
                font-family: "Medium";
                color: #ff383e;
                .icon {
                  font-size: 12px;
                  margin-right: -5px;
                }
              }
              .icon1 {
                margin-left: -3.5px;
              }
            }
            .right {
              height: 100%;
              margin-top: 12px;
              float: right;
              width: 31px;
              height: 13px;
              margin-right: 7px;
              .img {
                width: 100%;
                height: 100%;
                display: block;
              }
            }
            .wei {
              width: 22px;
              height: 13px;
              .img {
                width: 100%;
                height: 100%;
                display: block;
              }
            }
          }
        }
      }
    }
    .plus {
      width: 100%;
      height: 18px;
      line-height: 18px;
      color: #666666;
      font-size: 12px;
      display: inline-block;
      position: relative;
      box-sizing: border-box;
      padding-left: 43px;
      margin-top: 12px;
      .tag {
        width: 29px;
        height: 16px;
        position: absolute;
        left: 10px;
        bottom: 0;
      }
    }
    .pointbox {
      width: 100%;
      height: 16px;
      line-height: 16px;
      font-size: 12px;
      color: #666666;
      display: flex;
      position: relative;
      padding-left: 43px;
      margin-top: 6px;
      box-sizing: border-box;
      .tag {
        position: absolute;
        width: 29px;
        height: 16px;
        left: 10px;
        top: 0;
      }
    }
  .zhanwei {
    width: 100%;
    height: 100px;
  }
</style>
